import request from '@/utils/request'

// 查询进货管理列表
export function listPurchase(query) {
  return request({
    url: '/veterinary/purchase/list',
    method: 'get',
    params: query
  })
}

// 查询进货管理详细
export function getPurchase(purchaseId) {
  return request({
    url: '/veterinary/purchase/' + purchaseId,
    method: 'get'
  })
}

// 新增进货管理
export function addPurchase(data) {
  return request({
    url: '/veterinary/purchase',
    method: 'post',
    data: data
  })
}

// 修改进货管理
export function updatePurchase(data) {
  return request({
    url: '/veterinary/purchase',
    method: 'put',
    data: data
  })
}

// 删除进货管理
export function delPurchase(purchaseId) {
  return request({
    url: '/veterinary/purchase/' + purchaseId,
    method: 'delete'
  })
}

// 生成采购单号
export function generateOrderNo() {
  return request({
    url: '/veterinary/purchase/generateOrderNo',
    method: 'get'
  })
}

// 查询待验收采购单列表
export function getPendingList() {
  return request({
    url: '/veterinary/purchase/pending',
    method: 'get'
  })
}

// 验收入库操作
export function processAcceptance(data) {
  return request({
    url: '/veterinary/purchase/acceptance',
    method: 'post',
    data: data
  })
}